'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
    
    const { DATE, NOW } = Sequelize;

    // 此处可优化我觉得这里有问题

    await queryInterface.addColumn('users','create_time',{
      type:DATE,
      defaultValue:NOW
    })

    await queryInterface.addColumn('users','update_time',{
      type:DATE
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    await queryInterface.removeColumn('users','create_time');
    await queryInterface.removeColumn('users','update_time');
  }
};
